import request from '@/api/request'

//获取地址列表
function getAddressList(data) {
    return request({
        url: "/lejuAdmin/companyAddress/addressList",
        data,
    })
}
//设置发货默认
function setSendOne(data) {
    return request({
        url: '/lejuAdmin/companyAddress/setSendOne',
        data,
        method: 'POST'
    })
}
//设置收货默认
function setReceiveOne(data) {
    return request({
        url: "/lejuAdmin/companyAddress/setReceiveOne",
        data,
        method: 'POST'
    })
}
//删除地址
function companyAddress(id, data) {
    return request({
        url: `/lejuAdmin/companyAddress/${id}`,
        data,
        method: 'DELETE'
    })
}
//新增地址
function save(data) {
    return request({
        url: '/lejuAdmin/companyAddress/save',
        data,
        method: 'POST'
    })
}
//更新地址
function update(data) {
    return request({
        url: "/lejuAdmin/companyAddress/update",
        data,
        method: 'POST'
    })
}
//地址明细
function AddressInfo(id, data) {
    return request({
        url: `/lejuAdmin/companyAddress/${id}`,
        data,
    })
}
export {
    getAddressList,
    setSendOne,
    setReceiveOne,
    companyAddress,
    save,
    update,
    AddressInfo
}